﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UFSoft.UBF.UI.IView;
using UFSoft.UBF.UI.MD.Runtime;

namespace UFIDA.U9.Cust.Cli.PlugUI
{
    internal class UIHelper
    {
        /// <summary>
        /// 前端报错,方法支持具体字段
        /// </summary>
        /// <param name="record"></param>
        /// <param name="attri"></param>
        /// <param name="eMsg"></param>
        public static void SetErrorMsg(IPart part,IUIRecord record, string attri, string eMsg)
        {
            if (record != null && !string.IsNullOrEmpty(attri))
            {
                part.Model.ErrorMessage.SetErrorMessage(ref record, attri, eMsg);
            }
            IUIModel model = part.Model as IUIModel;
            part.Model.ErrorMessage.SetErrorMessage(ref model, eMsg);
        }
    }
}
